- content_for :wide do
  .form.editor.box.light-gray
    = form_for [:documents, @article], :html => { :multipart => true, :onsubmit => "return checkFileSize('article_document_attributes_image');" }  do |f|
      - if @article.errors.present?
        %ul.errors
          - @article.errors.full_messages.each do |msg|
            %li= msg

      = f.fields_for :document do |doc|
        .left= doc.label :title
        .right= doc.text_field :title, :class => "wide"

        .left &nbsp;
        .right
          = doc.check_box :comments_allowed
          = doc.label :comments_allowed

        .clearfix

        .left= label_tag 'article[document_attributes][body]', "Текст документа"
        .right= cktext_area_tag('article[document_attributes][body]', doc.object.body, :toolbar => 'Custom')

        .clearfix

        .left= label_tag nil, "Ключевые слова", :style => "margin-top: 15px;"
        .right
          #tags_fields
            - inputs_for_document_tags(doc.object) do |inputs|
              .tag-fields= inputs
            = link_to "", "#", :id => "new_tag_field"

        .clearfix

        .left= label_tag nil, "Изображение", :style => "margin-top: 15px;"
        .right
          = image_tag doc.object.image.url(:thumb)
          = file_field_tag 'article[document_attributes][image]'

        .clearfix

        .left &nbsp;
        .right.actions
          = f.submit t('submit'), :class => "btn primary small"
          = link_to t('back'), :back, :class => "btn small"

        .clearfix
